'use strict';
module.exports = (app) => {
  // 轮播图表
  const { INTEGER, STRING } = app.Sequelize;
  const CarouselGrop = app.model.define('s_carousel_group', {
    id: { type: INTEGER, primaryKey: true, autoIncrement: true },
    project_id: {
      type: INTEGER,
      comment: '项目id',
    },
    site: {
      type: STRING,
      comment: '位置',
      defaultValue: '首页',
    },
  });

  CarouselGrop.associate = function () {
    app.model.Tables.Shop.CarouselGrop.hasMany(app.model.Tables.Shop.Carousel, {
      foreignKey: 'site_id',
    });
  };

  return CarouselGrop;
};
